package com.cloudfun.campusshare.common.constant;

/**
 * @author : zhangyongjie
 * @version : 1.0
 * @createTime : 2020/4/17 9:38
 * @description : 消费记录类型
 */
public enum BillType {
    PAY_SUCCESS(1, "付款"),
    REFUND_SUCCESS(2, "退款");

    private int code;
    private String message;

    BillType(int code, String message) {
        this.code = code;
        this.message = message;
    }

    public int getCode() {
        return code;
    }

    public String getMessage() {
        return message;
    }

    public static BillType getTypeByCode(int code) {
        BillType[] values = BillType.values();
        for (BillType billType : values) {
            if (billType.code == code) {
                return billType;
            }
        }
        return null;
    }
}
